#include "ListItem.h"
#include <stdlib.h>
#include <iostream>
using namespace std;

ListItem::ListItem(int m,int s,ListItem *l)
{
	MemoryIndex = m;
	BlockSize = s;
	Next = l;
}

ListItem::~ListItem(void)
{
}

void ListItem::setNext(ListItem  *other)
{
	Next = other;
}
ListItem * ListItem::getNext()
{	
	return Next;
}

ostream & operator<<(ostream &os,const ListItem *other)
{
if (other==NULL)
	os<<"NULL"<<endl;
else
{
	os<<"Memory Index = "<<other->MemoryIndex<<endl;
	os<<"Block Size   = "<<other->BlockSize<<endl;
}
return os;
}

bool ListItem::operator==(const ListItem & other)
{
	return ((BlockSize  == other.BlockSize) &&
	    	MemoryIndex == other.MemoryIndex);
}

